{template 'common/header'}
{if IMS_VERSION<1}
<link href="{MODULE_URL}/template/static/css/wq1.0.css" rel="stylesheet">
{/if}
<style>

.audit{cursor:pointer;}

</style>
{if IMS_VERSION<1}<link href="{MODULE_URL}/template/static/css/wq1.0.css" rel="stylesheet">{/if}
<div class="main">
 <ul class="nav nav-tabs">
	<li{if $_GPC['ty'] == '' && $_GPC['do'] == 'votelist' && $_GPC['ranking'] == ''  } class="active"{/if}><a href="{php echo $this->createWebUrl('votelist',array('rid'=>$_GPC['rid']));}">全部投票</a></li>
    
	<li{if $_GPC['ty'] == 'order' && $_GPC['ispay']==""} class="active"{/if}><a href="{php echo $this->createWebUrl('votedata',array('rid'=>$_GPC['rid'],'ty'=>order));}">全部订单</a></li>
	<li{if $_GPC['ispay'] == '1'} class="active"{/if}><a href="{php echo $this->createWebUrl('votedata',array('rid'=>$_GPC['rid'],'ty'=>order,'ispay'=>1));}">付款订单</a></li>
	<li{if $_GPC['ispay'] == '0'} class="active"{/if}><a href="{php echo $this->createWebUrl('votedata',array('rid'=>$_GPC['rid'],'ty'=>order,'ispay'=>0));}">未付款订单</a></li>
	
	

</ul>

    
 
    <div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">


<div class="row">
  <div class="col-sm-6 col-md-1">
	<div class="thumbnail">
	  <img src="{php echo tomedia($voteuser['img1']);}" alt="...">
	</div>
  </div><span class="label label-default">{$voteuser['name']}</span>
  <button class="btn btn-primary" type="button">  票数 <span class="badge">{$voteuser['votenum']}</span>
</button> <button class="btn btn-primary" type="button">  钻石 <span class="badge">{$voteuser['diamondnum']}</span>
</button>

</div>
<div class="alert alert-warning alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>说明：</strong>票数可能和列表不符，因为 “票数=普通票数+钻石数量*倍数”决定，还有可以编辑。
</div>
		<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
        	<input type="hidden" name="m" value="tyzm_diamondvote" />
        	<input type="hidden" name="do" value="votedata" />
			<input type="hidden" name="rid" value="{$_GPC['rid']}" />
			<input type="hidden" name="id" value="{$_GPC['id']}" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
				<div class="col-sm-8 col-lg-9">
					<input class="form-control" name="keyword" id="" placeholder="输入ip，昵称" type="text" value="{$_GPC['keyword']}">
				</div>
                                <div class=" col-xs-12 col-sm-2 col-lg-2">
					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
				</div>
			</div>
 			<div class="form-group">
			</div>
		</form>
	</div>
 
    </div>
    <div style="padding:15px;">
        <table class="table table-hover">
            <thead class="navbar-inner">
                <tr><th  width="50">ID</th>	
					<th>用户</th>	
                    
					{if $_GPC['ty']=="diamondnum"}
					<th>钻石</th>
					<th>订单号</th>
					{/if}
					<th>ip</th>
					<th>时间</th>
                    <th style="width:50px;">操作</th>
                </tr>
            </thead>
            <tbody>
                {loop $list $row}
                <tr>

                    <td>{$row['id']}</td>
					<td style="text-align:center"><img src="{media $row['avatar']}" width="48"><br />{$row['nickname']}</td>
														
	               {if $_GPC['ty']=="diamondnum"}
					<td>{$row['fee']}</td>
					<td>{$row['ptid']}</td>
					
					{/if}
					<td>{$row['user_ip']}</td>	
					<td>{php echo date('Y-m-d H:i:s',$row['createtime'])}</td>
                    
                    <td >
					<a class="btn  btn-danger" rel="tooltip" href="#" onclick="drop_confirm('您确定要删除吗?删除不可恢复，同时删除所有相关数据！', '{php echo $this->createWebUrl('deletevoteuser',array('id'=>$row['id'],'rid'=>$row['rid']))}');" title="删除"><i class="fa fa-times"></i></a>
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    </div>

</div>
<script>
$(function(){

            $(".check_all").click(function(){
            var checked = $(this).get(0).checked;
                    $("input[type=checkbox]").attr("checked", checked);
            });
                    $("input[name=deleteall]").click(function(){

            var check = $("input:checked");
                    if (check.length < 1){
            err('请选择要删除的记录!');
                    return false;
            }
            if (confirm("确认要删除选择的记录?")){
            var id = new Array();
                    check.each(function(i){
                    id[i] = $(this).val();
                    });
                    $.post('{php echo create_url('site/module', array('do' => 'deleteAll', 'name' => 'tyzm_pintu'))}', {idArr:id}, function(data){
                    if (data.errno == 0)
                    {
                    location.reload();
                    } else {
                    alert(data.error);
                    }


                    }, 'json');
            }

            });
			
			

$(".audit").click(function(){
    var clickthis=$(this);
    var did=clickthis.attr('data-id');
	var audit=clickthis.attr('data-s');
	$.ajax({
		type : "post",
		url : "{php echo $this->createWebUrl('ajaxset',array('rid'=>$_GPC['rid'],'ty'=>'audit'))}",
		data : {
			id : did,
			audit : audit,
		},
		dataType : "json",
		success : function(res) {
			if (res.status == 200) {
			    clickthis.attr('data-s',(1-audit));
				if(clickthis.hasClass('label-success')){
				    clickthis.removeClass("label-success");
                    clickthis.addClass('label-info');
					clickthis.html('待审核');
                }else{
				    clickthis.removeClass("label-info");
				    clickthis.addClass('label-success');
					clickthis.html('已审核');
				}
			}
		}

	});
});		
			
			
			
			
			
			
			
			
                    });</script>
<script>
            function drop_confirm(msg, url){
            if (confirm(msg)){
            window.location = url;
            }
            }
</script>

{template 'common/footer'}